#include <stdio.h>
#include <stdbool.h>
int main()
{
    bool prime(int n);
    printf("please enter n=");
    int n;
    scanf("%d",&n);
    if (prime(n))
         printf("%d is a prime.",n);
    else
        printf("%d not is a prime.",n);
    return 0;
}

bool prime(int n)
{
    if (n == 2)
        return true;

    int i = 2;
    while (i <= n - 1)
    {
        if (n % i == 0) {
            return false;
        }
        i++;
    }
    return true;
}